﻿define([], function(){
    var tpl = {};
    tpl.tabs = function(){
        var html = '';
        html += tabs();
        return html;
    };
    tpl.init1 = function(){
        var html = '';
        html += nbna();
        return html;
    };
    tpl.init2 = function(){
        var html = '';
        html += quesTabs();
        return html;
    };
    var tabs = function(){
        return '<script type = "text/html" id="tabs-tpl">'+
            '{{each data as value,i}}'+
            '<li class="{{if i == 0}} checked {{/if}}" quesType = "{{value.quesType}}" item = "{{value.item}}" ids = "{{value.ids}}" {{if value.end}}end = "{{value.end}}"{{/if}}>{{value.item}}</li>'+
            '{{/each}}'+
            '</script>'
    };
    var nbna = function(){
        return '<script type = "text/html" id="nbna-tpl">'+
                    '{{each data as value,i}}'+
                    '<ul class="clearfix ques-item {{if i == 0}}ques-checked{{/if}}" id="{{value.id}}" options="{{value.option}}" score = "{{value.score}}">'+
                        '<li><div>{{value.id}}</div></li>'+
                        '<li><div>{{value.title}}</div></li>'+
                        '<li>{{value.desc}}</li>'+
                    '</ul>'+
                    '{{/each}}'+
                '</script>'
    };
    var quesTabs = function(){
        return '<script type = "text/html" id="quesTabs-tpl">'+
            '<li>评定</li>'+
            '{{each data as value,i}}'+
            '<li class="options" quesId="{{value.id}}" val= "{{value.value}}">{{value.opt}}</li>'+
            '{{/each}}'+
            '</script>'
    };
    return tpl;
});